Skip to content

Conversation

@arshidkv12
Copy link
Contributor

No description provided.

--TEST--
mkdir(): invalid mode
--FILE--
<?php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add few more cases (e.g. -1)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@arshidkv12 arshidkv12 requested a review from devnexen February 8, 2026 03:36
Z_PARAM_RESOURCE_OR_NULL(zcontext)
ZEND_PARSE_PARAMETERS_END();

if (mode < 0 || (mode & ~07777)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it makes sense to provide a Zend API for this. As a lot of code does file permissions checks (including INI settings (or should at least))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve created a helper function zend_validate_file_permissions(). I think this can be used to validate permission masks for any filesystem-related operations. Please let me know if this approach makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants